/* Database.java
 *
 * Copyright 2011 Aleksey Konovalov
 * All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>. 
 * 
 */

package org.jimm.db;

import android.net.Uri;
import android.provider.BaseColumns;

/**
 * �������� ��� ������ � ��
 *
 * @author ������� ��������� (aleks_dsp)
 */
public final class JimmDatabase {

    public static final String AUTHORITY = "org.jimm.db.JimmDatabaseProvider";

    /**
     * ������� Accounts
     */
    public static final class Accounts implements BaseColumns {

        private Accounts() {
        }

        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/accounts");

        /**
         * ������������� �������� (�����)
         */
        public static final String LOGIN = "login";
        public static final String PASSWORD = "password";
        public static final String NICK = "nick";
        public static final String STATUS_INDEX = "status_index";
        public static final String STATUS_MESSAGE = "status_message";

        /**
         * ��������� ����� ����������
         */
        public static final String FLAGS = "flags";

        public static final int FLAG_ACTIVE = 1 << 1;
        public static final int FLAG_AUTOCONNECT = 1 << 2;

        /**
         * ��� �������� (ICQ, Jabber � �.�)
         * 1 - ICQ
         */
        public static final String TYPE = "type";

        // ���������, ���� �� ������� ����� ����������� � ���� TYPE
        public static final int PROTOCOL_ICQ = 1;
        public static final int PROTOCOL_JABBER = 2;
        public static final int PROTOCOL_GTALK = 3;
        public static final int PROTOCOL_FACEBOOK = 4;
        public static final int PROTOCOL_LJ = 5;
        public static final int PROTOCOL_YANDEX = 6;
        public static final int PROTOCOL_VK = 7;
        public static final int PROTOCOL_QIP = 8;
        public static final int PROTOCOL_ODNOKLASSNIKI = 9;
    }


    public static final class History {

        private History() {
        }

        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/history");

        public static final String ACCOUNT = "account";

        /**
         * ���� ����� � �������� contacts
         */
        public static final String CONTACT = "contact";

        /**
         * ���� ���������/�������� ���������
         */
        public static final String DATE = "date";

        /**
         * ����� ���������
         */
        public static final String MESSAGE = "message";

        /**
         * �����
         */
        public static final String FLAGS = "flags";

        /**
         * �������� ���������
         */
        public static final int FLAG_RECEIVED_MESSAGE = 1;

        /**
         * ��������� �� ���������
         */
        public static final int FLAG_IS_READED = 2;
    }


    // ��������
    public static final class Contacts implements BaseColumns {

        private Contacts() {
        }

        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/contacts");

        /**
         * �������, �������� ����������� �������
         */
        public static final String ACCOUNT = "account";

        /**
         * ������������� ��������
         */
        public static final String CONTACT_ID = "contact_id";

        /**
         * ��� ��������
         */
        public static final String NICK = "nick";

        /**
         * ����� � �������� Groups
         */
        public static final String GROUP = "groupId";
    }


    // ������ ���������
    public static final class Groups implements BaseColumns {

        private Groups() {
        }

        public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/groups");

        public static final String NAME = "name";

    }
}
